using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;

namespace CodePlex.Resourceful
{


    public interface IHttpContext
    {
        IHttpRequest Request { get; }
        IHttpResponse Response { get; }


        Uri RootUri { get; }

        string BasicAuthUsername { get; }
        string BasicAuthPassword { get; }

    }



    public interface IHttpRequest
    {
        bool IsRelative { get; }
        string RelativeUri { get; }
        string HttpMethod { get; }

        ReadOnlyList<string> AcceptTypes { get; }
        string ContentType { get; }

        Stream GetRequestStream();

        NameValuePairs Headers { get; }
    }

    public interface IHttpResponse
    {
        string ContentType { get;set; }

        int StatusCode { get;set; }

        string StatusDescription { get;set; }

        long ContentLength { set;}

 
        Stream GetOutputStream();

        void End();


        bool IsEnded { get; }

        void SetHeader(string name, string value);
    }


    public interface IService
    {
        void Process(IHttpContext context);
    }




    public interface IRetryStrategy
    {
        bool IsAllowed { get; }
        TimeSpan WaitSpan { get; }
        IRetryStrategy Next();
    }



}
